/**      
 * @file		fixGetProblem2.cpp
 * @description		This application fixes the problem with using cin's get member function.
 *					
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		2.0
 */
#include <iostream>
using namespace std;

/**
 * Clears the next new line character from the input stream.
 * @param	aInput the input stream to clear a new line from
 * @pre		the input stream has been initialized and is not at
 *	    	the EOF
 * @post	the next newline character has been removed from the
 *		stream
 */
void clearNewLine(istream& aInput);

/**
 * @return zero if the application executes successfully
 */
int main() {
	cout << "Enter a number:\n";
	int number;
	cin >> number;
	
	cout << "Now enter a letter:\n";
	char ch;
	clearNewLine(cin);
	cin.get(ch);
	
    cout << "The number is: '" << number << "'\n";
	cout << "The character is: '" << ch << "'\n";

	return 0;
}

void clearNewLine(istream& aInput) {
	char ch;
	do {
	    aInput.get(ch);
	} while(ch != '\n');
}

